package blog_type

import "encoding/json"

type ImagesType int

const (
	Local  ImagesType = 1 // 本地
	QinNiu ImagesType = 2 // 七牛
)

func (s ImagesType) MarshalJSON() ([]byte, error) {
	return json.Marshal(s.String())
}

func (s ImagesType) String() string {
	var str string
	switch s {
	case Local:
		str = "本地"
	case QinNiu:
		str = "七牛"
	default:
		str = "其他方式"
	}
	return str
}
